package com.zte.cl.utils;

import org.apache.log4j.Logger;


public class AESEncrypt {
	
	// 日志对象
	private static Logger logger = Logger.getLogger(AESEncrypt.class);
	
	/**
	 * 加密
	 * @param seq
	 * @param content
	 * @return
	 */
	public static String enCrypt(String seq, String content){
		String result = null;
		try{
			//String key = "b2xkcGhvdG9vbGRwbGFjZWkmdQ==";
			String key = "b2xkcGhvdG9vbGRw";
			result = AESEncryptUtil.cryptHex(content, key);
		}catch(Exception e){
			e.printStackTrace();
			logger.error("字符串:"+content+"加密失败",e);
			return null;
		}
		return result;
	}
	
	/**
	 * 解密
	 * @param seq
	 * @param content
	 * @return
	 */
	public static String deCrypt(String seq, String content){
		String result = null;
		try{
			//String key = "b2xkcGhvdG9vbGRwbGFjZWkmdQ==";
			String key = "b2xkcGhvdG9vbGRw";
			result = AESEncryptUtil.decryptHex(content, key);
		}catch(Exception e){
			e.printStackTrace();
			logger.error("字符串:"+content+"解密失败",e);
			return null;
		}
		return result;
	}
}